setProgress

open fun setProgress(progress: Int)(source)

Sets the current progress to the specified value. Does not do anything if the progress bar is in indeterminate mode.

This method will immediately update the visual position of the progress indicator. To animate the visual position to the target value, use setProgress}.

Parameters

progress

the new progress, between getMin and getMax

See also


open fun setProgress(progress: Int, animate: Boolean)(source)

Sets the current progress to the specified value, optionally animating the visual position between the current and target values.

Animation does not affect the result of getProgress, which will return the target value immediately after this method is called.

Parameters

progress

the new progress value, between getMin and getMax

animate

true to animate between the current and target values or false to not animate